function SPController($scope, $routeParams, $http){
	$scope.name = "SPController";
	$scope.params = $routeParams;
	$scope.store = {};
	$scope.url = 'http://api.kouponmedia.com/UserService.svc/getpromolist/6348256714038520009a57d1d2-5188-457b-854b-86aafea65fc5?macaddress=12345rger3g3&sourceapp=app&merchant=4825&fromdt=11%2F08%2F2012&todt=11%2F08%2F2012';

 $scope.update = function (user) {
     $scope.store = angular.copy(user);
        $.ajax({
            type: 'GET',
            url: $scope.url,
            processData:'true',
            dataType: 'json',
            async: false,
            success: function (data) {
                $scope.profile.code = data.code;
                console.log($scope.profile.code);

            },
            error: function (xmlHttpRequest, textStatus, errorThrown) {
                alert(textStatus);
                alert(errorThrown);
            }

        });
    };
}
    
/*
    $scope.update = function(user){
        $scope.store = angular.copy(user);
        var JSONObject =  $resource($scope.url, { },
        {
            'get' : { method: 'GET', params: { format: '.json' } , isArray : false }
        }
        )
        console.log(JSONObject.get());
    }*/